	<?php
	include_once('./mvc/modelo/diseno.php');
	include_once('./mvc/modelo/Accesatabla.php');
	$depart = new Accesatabla('departamentos');
	$ds = new diseno();
	if($_GET['idepa'] == ''){
		$cont='<center>
			<form method="POST" action="./?url=addepa">
				<table>
					<tr>
						<th colspan="2"><h3>Datos del Departamento</h3></th>
					</tr>
					<tr>
						<td>Nombre del Departamento:</td>
						<td><input type="text" id="nomdep" name="nomdep" required></td>
					</tr>
					<tr>
						<td>Pago x hora:</td>
						<td><input type="text" id="pagohora" name="pagohora" required></td>
					</tr>
				</table>
				<input type="submit" value="Guardar">
			</form></center>';
	}
	else{
		$depart->buscarprimaria($_GET['idepa']);
		$cont='<center>
			<form method="POST" action="./?url=addepa&id='.$_GET['idepa'].'">
				<table>
					<tr>
						<th colspan="2"><h3>Datos del Departamento</h3></th>
					</tr>
					<tr>
						<td>Nombre del Departamento:</td>
						<td><input type="text" id="nomdep" name="nomdep" value="'.$depart->obtener('nombredepartamento').'" required></td>
					</tr>
					<tr>
						<td>Pago x hora:</td>
						<td><input type="text" id="pagohora" name="pagohora" value="'.$depart->obtener('pagoxhora').'" required></td>
					</tr>
				</table>
				<input type="submit" value="Guardar">
			</form></center>';
	}
	//$ds->nav($_SESSION[navegador]);
	$ds->contenido($cont);
	$ds->mostrar();
?>



